//
//  UserDetailHeaderCell.swift
//  TCMHealth
//
//  Created by 刘占雨 on 2023/7/19.
//

import UIKit

class UserDetailCell: UITableViewCell {

    @IBOutlet weak var diseaseDesLabel: UILabel!
    
    @IBOutlet weak var diseaseDesPhotoView: UIView!
    var diseaseDesSinaPhotoView: SinaPhotoView!
    @IBOutlet weak var diseaseDesHeight: NSLayoutConstraint!
    @IBOutlet weak var opinionLabel: UILabel!
    
    @IBOutlet weak var medicineNameLabel: UILabel!

    @IBOutlet weak var medicineView: UIView!
    
    @IBOutlet weak var medicineDesLabel: UILabel!
    @IBOutlet weak var medicineViewHeight: NSLayoutConstraint!
    @IBOutlet weak var desLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.diseaseDesSinaPhotoView = SinaPhotoView.init(frame: CGRect(x: 20, y: 10, width: diseaseDesPhotoView.width - 40, height: 90))
        self.diseaseDesPhotoView.addSubview(diseaseDesSinaPhotoView)
//        self.diseaseDesSinaPhotoView.model = .LocalEdit
//        self.diseaseDesSinaPhotoView.deleteBtnClosure = { [unowned self] index , model ,imageView in
//            assetArray.remove(at: index)
            updatePhotoView()
    }
    
    func updatePhotoView() {
//        diseaseDesPhotoView.isHidden = assetArray.count == 0
//        diseaseDesPhotoView.constant = assetArray.count == 0 ? 0 : 110
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    var userDes: UserDes {
        set {
            diseaseDesLabel.text = newValue.diseaseDes
            opinionLabel.text = newValue.opinion
            medicineDesLabel.text = newValue.medicineDes
//            genderLabel.text = newValue.gender
//            ageLabel.text = newValue.age
        }

        get {
            return self.userDes
        }
    }

}
